

# f1 = open('./data/a1.txt', encoding = "utf-8")
# print(f1.read())




# f1.close()

import os

path = '/home/xyt/pro/yolo_v4/data/a4/'
prefix = '004'
suffix = '.jpg'


fileList = os.listdir(path)

m = 382
n = m
for inner_file in fileList:

    old_name = path + os.sep + inner_file 
    if os.path.isdir(old_name): 
        continue
    new_name = path + os.sep + prefix + str(n) + suffix
    os.rename(old_name, new_name)  
    n += 1

print("rename", n-m, "file")
